package com.aabte.mybatis.mapper;

import com.aabte.mybatis.bean.Employee;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;

public interface EmployeeMapperDynamicSQL {

    /**
     * 测试where标签
     * @param employee
     * @return
     */
    List<Employee> findEmployeeByCondition4WhereAndIf(Employee employee);

    /**
     * 测试trim标签
     * @param employee
     * @return
     */
    List<Employee> findEmployeeByCondition4TrimAndIf(Employee employee);

    List<Employee> findEmployeeByIds4Foreach(@Param("ids") List<Integer> ids);

    /**
     * 提供Id，就根据ID查询
     * 提供lastName，就根据LastName查询
     * @param employee
     * @return
     */
    List<Employee> findEmployeeByConditionIf4Choose(Employee employee);

    long updateEmployee4Set(Employee employee);

    long updateEmployee4Trim(Employee employee);

    long insertEmployeeList4Foreach(@Param("employeeList") Collection<Employee> employee);

    List<Employee> findEmployee4InnerParameter(Employee employee);

}
